//
//  LJKnowledgeTitleCell.m
//  LJDemo
//
//  Created by 蔡万鸿 on 16/5/29.
//  Copyright © 2016年 黄花菜. All rights reserved.
//

#import "LJKnowledgeTitleCell.h"

@interface LJKnowledgeTitleCell ()

@end

@implementation LJKnowledgeTitleCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

+ (instancetype)cellWithCollectionView:(UICollectionView *)collectionView {
    static NSString *ID = @"KnowledgeTitleCell";
    UINib *nib = [UINib nibWithNibName:@"LJKnowledgeTitleCell" bundle: [NSBundle mainBundle]];
    [collectionView registerNib:nib forCellWithReuseIdentifier:ID];
    LJKnowledgeTitleCell *cell = [[LJKnowledgeTitleCell alloc] init];
    return cell;
}

- (IBAction)segmentAction:(id)sender {
    UIButton *segmentButton = (UIButton *)sender;
    if (segmentButton.tag == 1) {
        self.segment_1_Button.titleLabel.font = [UIFont boldSystemFontOfSize:18.f];
        [self.segment_1_Button setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
        self.segBGLeft.hidden = YES;
        self.segment_2_Button.titleLabel.font = [UIFont systemFontOfSize:16.f];
        [self.segment_2_Button setTitleColor:[UIColor colorWithRed:58.f/255.f green:165.f/255.f blue:95.f/255.f alpha:1] forState:UIControlStateNormal];
        self.segBGRight.hidden = NO;
        self.segBlock(1);
    }
    else {
        self.segment_1_Button.titleLabel.font = [UIFont systemFontOfSize:16.f];
        [self.segment_1_Button setTitleColor:[UIColor colorWithRed:58.f/255.f green:165.f/255.f blue:95.f/255.f alpha:1] forState:UIControlStateNormal];
        self.segBGLeft.hidden = NO;
        self.segment_2_Button.titleLabel.font = [UIFont boldSystemFontOfSize:18.f];
        [self.segment_2_Button setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
        self.segBGRight.hidden = YES;
        self.segBlock(2);
    }
}


@end
